Optimal. Leaf size=525 \[ \frac {g^2 (d+e x)^{1+m} \left (a+b x+c x^2\right )^{1+p}}{c e (3+m+2 p)}+\frac {\left (e (b d-a e) g^2 (1+m)+c \left (2 d^2 g^2 (1+p)+e^2 f^2 (3+m+2 p)-2 d e f g (3+m+2 p)\right )\right ) (d+e x)^{1+m} \left (a+b x+c x^2\right )^p \left (1-\frac {2 c (d+e x)}{2 c d-\left (b-\sqrt {b^2-4 a c}\right ) e}\right )^{-p} \left (1-\frac {2 c (d+e x)}{2 c d-\left (b+\sqrt {b^2-4 a c}\right ) e}\right )^{-p} F_1\left (1+m;-p,-p;2+m;\frac {2 c (d+e x)}{2 c d-\left (b-\sqrt {b^2-4 a c}\right ) e},\frac {2 c (d+e x)}{2 c d-\left (b+\sqrt {b^2-4 a c}\right ) e}\right )}{c e^3 (1+m) (3+m+2 p)}-\frac {g (b e g (2+m+p)+2 c (d g (1+p)-e f (3+m+2 p))) (d+e x)^{2+m} \left (a+b x+c x^2\right )^p \left (1-\frac {2 c (d+e x)}{2 c d-\left (b-\sqrt {b^2-4 a c}\right ) e}\right )^{-p} \left (1-\frac {2 c (d+e x)}{2 c d-\left (b+\sqrt {b^2-4 a c}\right ) e}\right )^{-p} F_1\left (2+m;-p,-p;3+m;\frac {2 c (d+e x)}{2 c d-\left (b-\sqrt {b^2-4 a c}\right ) e},\frac {2 c (d+e x)}{2 c d-\left (b+\sqrt {b^2-4 a c}\right ) e}\right )}{c e^3 (2+m) (3+m+2 p)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.46, antiderivative size = 523, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 4, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.148, Rules used = {1667, 857, 773,
138} \begin {gather*} \frac {(d+e x)^{m+1} \left (a+b x+c x^2\right )^p \left (1-\frac {2 c (d+e x)}{2 c d-e \left (b-\sqrt {b^2-4 a c}\right )}\right )^{-p} \left (1-\frac {2 c (d+e x)}{2 c d-e \left (\sqrt {b^2-4 a c}+b\right )}\right )^{-p} F_1\left (m+1;-p,-p;m+2;\frac {2 c (d+e x)}{2 c d-\left (b-\sqrt {b^2-4 a c}\right ) e},\frac {2 c (d+e x)}{2 c d-\left (b+\sqrt {b^2-4 a c}\right ) e}\right ) \left (g^2 (b d-a e)+\frac {c \left (2 d^2 g^2 (p+1)-2 d e f g (m+2 p+3)+e^2 f^2 (m+2 p+3)\right )}{e (m+1)}\right )}{c e^2 (m+2 p+3)}-\frac {g (d+e x)^{m+2} \left (a+b x+c x^2\right )^p \left (1-\frac {2 c (d+e x)}{2 c d-e \left (b-\sqrt {b^2-4 a c}\right )}\right )^{-p} \left (1-\frac {2 c (d+e x)}{2 c d-e \left (\sqrt {b^2-4 a c}+b\right )}\right )^{-p} (b e g (m+p+2)+2 c d g (p+1)-2 c e f (m+2 p+3)) F_1\left (m+2;-p,-p;m+3;\frac {2 c (d+e x)}{2 c d-\left (b-\sqrt {b^2-4 a c}\right ) e},\frac {2 c (d+e x)}{2 c d-\left (b+\sqrt {b^2-4 a c}\right ) e}\right )}{c e^3 (m+2) (m+2 p+3)}+\frac {g^2 (d+e x)^{m+1} \left (a+b x+c x^2\right )^{p+1}}{c e (m+2 p+3)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 138
Rule 773
Rule 857
Rule 1667
Rubi steps
\begin {align*} \int (d+e x)^m (f+g x)^2 \left (a+b x+c x^2\right )^p \, dx &=\frac {g^2 (d+e x)^{1+m} \left (a+b x+c x^2\right )^{1+p}}{c e (3+m+2 p)}+\frac {\int (d+e x)^m \left (e \left (c e f^2 (3+m+2 p)-g^2 (a e (1+m)+b d (1+p))\right )-e g (2 c d g (1+p)+b e g (2+m+p)-2 c e f (3+m+2 p)) x\right ) \left (a+b x+c x^2\right )^p \, dx}{c e^2 (3+m+2 p)}\\ &=\frac {g^2 (d+e x)^{1+m} \left (a+b x+c x^2\right )^{1+p}}{c e (3+m+2 p)}-\frac {(g (2 c d g (1+p)+b e g (2+m+p)-2 c e f (3+m+2 p))) \int (d+e x)^{1+m} \left (a+b x+c x^2\right )^p \, dx}{c e^2 (3+m+2 p)}+\frac {\left (e (b d-a e) g^2 (1+m)+c \left (2 d^2 g^2 (1+p)+e^2 f^2 (3+m+2 p)-2 d e f g (3+m+2 p)\right )\right ) \int (d+e x)^m \left (a+b x+c x^2\right )^p \, dx}{c e^2 (3+m+2 p)}\\ &=\frac {g^2 (d+e x)^{1+m} \left (a+b x+c x^2\right )^{1+p}}{c e (3+m+2 p)}-\frac {\left (g (2 c d g (1+p)+b e g (2+m+p)-2 c e f (3+m+2 p)) \left (a+b x+c x^2\right )^p \left (1-\frac {d+e x}{d-\frac {\left (b-\sqrt {b^2-4 a c}\right ) e}{2 c}}\right )^{-p} \left (1-\frac {d+e x}{d-\frac {\left (b+\sqrt {b^2-4 a c}\right ) e}{2 c}}\right )^{-p}\right ) \text {Subst}\left (\int x^{1+m} \left (1-\frac {2 c x}{2 c d-\left (b-\sqrt {b^2-4 a c}\right ) e}\right )^p \left (1-\frac {2 c x}{2 c d-\left (b+\sqrt {b^2-4 a c}\right ) e}\right )^p \, dx,x,d+e x\right )}{c e^3 (3+m+2 p)}+\frac {\left (\left (e (b d-a e) g^2 (1+m)+c \left (2 d^2 g^2 (1+p)+e^2 f^2 (3+m+2 p)-2 d e f g (3+m+2 p)\right )\right ) \left (a+b x+c x^2\right )^p \left (1-\frac {d+e x}{d-\frac {\left (b-\sqrt {b^2-4 a c}\right ) e}{2 c}}\right )^{-p} \left (1-\frac {d+e x}{d-\frac {\left (b+\sqrt {b^2-4 a c}\right ) e}{2 c}}\right )^{-p}\right ) \text {Subst}\left (\int x^m \left (1-\frac {2 c x}{2 c d-\left (b-\sqrt {b^2-4 a c}\right ) e}\right )^p \left (1-\frac {2 c x}{2 c d-\left (b+\sqrt {b^2-4 a c}\right ) e}\right )^p \, dx,x,d+e x\right )}{c e^3 (3+m+2 p)}\\ &=\frac {g^2 (d+e x)^{1+m} \left (a+b x+c x^2\right )^{1+p}}{c e (3+m+2 p)}+\frac {\left (e (b d-a e) g^2 (1+m)+c \left (2 d^2 g^2 (1+p)+e^2 f^2 (3+m+2 p)-2 d e f g (3+m+2 p)\right )\right ) (d+e x)^{1+m} \left (a+b x+c x^2\right )^p \left (1-\frac {2 c (d+e x)}{2 c d-\left (b-\sqrt {b^2-4 a c}\right ) e}\right )^{-p} \left (1-\frac {2 c (d+e x)}{2 c d-\left (b+\sqrt {b^2-4 a c}\right ) e}\right )^{-p} F_1\left (1+m;-p,-p;2+m;\frac {2 c (d+e x)}{2 c d-\left (b-\sqrt {b^2-4 a c}\right ) e},\frac {2 c (d+e x)}{2 c d-\left (b+\sqrt {b^2-4 a c}\right ) e}\right )}{c e^3 (1+m) (3+m+2 p)}-\frac {g (2 c d g (1+p)+b e g (2+m+p)-2 c e f (3+m+2 p)) (d+e x)^{2+m} \left (a+b x+c x^2\right )^p \left (1-\frac {2 c (d+e x)}{2 c d-\left (b-\sqrt {b^2-4 a c}\right ) e}\right )^{-p} \left (1-\frac {2 c (d+e x)}{2 c d-\left (b+\sqrt {b^2-4 a c}\right ) e}\right )^{-p} F_1\left (2+m;-p,-p;3+m;\frac {2 c (d+e x)}{2 c d-\left (b-\sqrt {b^2-4 a c}\right ) e},\frac {2 c (d+e x)}{2 c d-\left (b+\sqrt {b^2-4 a c}\right ) e}\right )}{c e^3 (2+m) (3+m+2 p)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [F]
time = 1.53, size = 0, normalized size = 0.00 \begin {gather*} \int (d+e x)^m (f+g x)^2 \left (a+b x+c x^2\right )^p \, dx \end {gather*}
Verification is not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.06, size = 0, normalized size = 0.00 \[\int \left (e x +d \right )^{m} \left (g x +f \right )^{2} \left (c \,x^{2}+b x +a \right )^{p}\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int {\left (f+g\,x\right )}^2\,{\left (d+e\,x\right )}^m\,{\left (c\,x^2+b\,x+a\right )}^p \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________